<!---- 模板 on 2017/3/30 -->
<script ng-init="initCss()"></script>
<div class="page">
    <header class="bar bar-nav">
        <a class="icon icon-left pull-left" href="javascript:history.back(-1);"></a>
        <h1 class="title">数据统计</h1>
    </header>
    <div class="content" ng-init="">
        <div class="content-block-title">总统计</div>
        <div class="list-block">
            <ul>
                <li>
                    <a class="item-content item-link open-popup" href="javascript:;" data-popup=".popup-total-running">
                        <div class="item-media"><i class="icon icon-f7"></i></div>
                        <div class="item-inner">
                            <div class="item-title">设备总运行数据统计</div>
                        </div>
                    </a>
                </li>
                <li>
                    <a class="item-content item-link open-popup" href="javascript:;" data-popup=".popup-total-maintain">
                        <div class="item-media"><i class="icon icon-f7"></i></div>
                        <div class="item-inner">
                            <div class="item-title">设备总保养数据统计</div>
                        </div>
                    </a>
                </li>
                <li>
                    <a class="item-content item-link open-popup" href="javascript:;" data-popup=".popup-total-repair">
                        <div class="item-media"><i class="icon icon-f7"></i></div>
                        <div class="item-inner">
                            <div class="item-title">设备总维修数据统计</div>
                        </div>
                    </a>
                </li>
            </ul>
        </div>
        <div class="content-block-title">单个设备数据统计</div>
        <div class="list-block">
            <ul>
                <li ng-repeat="device in devices track by device.deviceNo">
                    <a class="item-content item-link open-popup" href="javascript:;"
                       ng-click="enterSingleDevice($index)" data-popup=".popup-device">
                        <div class="item-media"><i class="icon icon-f7"></i></div>
                        <div class="item-inner">
                            <div class="item-title">[{{device.deviceNo}}]:{{device.deviceName}}</div>
                        </div>
                    </a>
                </li>
            </ul>
        </div>
    </div>
</div>
<div class="popup popup-total-running">
    <p class="text-center"><a href="javascript:;" class="close-popup">∨</a></p>
    <div class="content-block">
        <ul>
            <li>平均每台设备日均运行时长：{{totalStatistics.running.dailyAverage|number:2}}h</li>
            <li>平均每台设备月均运行时长：{{totalStatistics.running.monthlyAverage|number:2}}h</li>
            <li>平均每台设备年均运行时长：{{totalStatistics.running.annualAverage|number:2}}h</li>
            <li>平均每台设备开机率：{{totalStatistics.total.bootRate | percentage}}</li>
            <li>平均每台设备故障率：{{totalStatistics.total.failureRate | percentage}}</li>
        </ul>
    </div>
</div>
<div class="popup popup-total-maintain">
    <p class="text-center"><a href="javascript:;" class="close-popup">∨</a></p>
    <div class="content-block">
        <ul>
            <li>所有设备总保养次数：{{totalStatistics.maintain.totalTimes}}次</li>
            <li ng-repeat="maintainPlan in totalStatistics.maintain.maintainsStatistics">
                {{$index+1}}级保养
                <ul>
                    <li>所有设备保养次数：{{maintainPlan.totalTimes}}</li>
                    <li>所有设备当年保养总次数：{{maintainPlan.totalInYear}}</li>
                    <li>所有设备当月保养总次数：{{maintainPlan.totalInMonth}}</li>
                    <li>平均所有设备年均保养次数：{{maintainPlan.annualAverageTimes|number:2}}</li>
                    <li>平均所有设备月均保养次数：{{maintainPlan.monthlyAverageTimes|number:2}}</li>
                </ul>
            </li>
        </ul>
    </div>
</div>
<div class="popup popup-total-repair">
    <p class="text-center"><a href="javascript:;" class="close-popup">∨</a></p>
    <div class="content-block">
        <ul>
            <li>当年所有设备总维修次数：{{totalStatistics.repair.totalInMonth}}</li>
            <li>当月所有设备总维修次数：{{totalStatistics.repair.totalInYear}}</li>
            <li>所有设备总维修次数：{{totalStatistics.repair.totalTimes}}</li>
            <li>当年所有设备维修总支出：{{totalStatistics.repair.totalCostInYear | currency:'￥'}}</li>
            <li>当所有设备月维修总支出：{{totalStatistics.repair.totalCostInMonth | currency:'￥'}}</li>
            <li>所有设备维修总支出：{{totalStatistics.repair.totalCost | currency:'￥'}}</li>
            <li>所有设备维修总耗用时间：{{totalStatistics.repair.totalCostTime}}h</li>
            <li>所有设备月度维修率均值：{{totalStatistics.repair.monthlyRate | percentage}}</li>
            <li>所有设备年度维修率均值：{{totalStatistics.repair.annuallyRate | percentage}}</li>
        </ul>
    </div>
</div>
<div class="popup popup-device">
    <p class="text-center"><a href="javascript:;" class="close-popup">∨</a></p>
    <div class="content-block">
        <ul ng-if="thisDevice != null">
            <li>设备信息
                <ul>
                    <li>设备编号：{{thisDevice.deviceNo}}</li>
                    <li>设备名称：{{thisDevice.deviceName}}</li>
                    <li>设备注册天数：{{thisDevice.statistics.running.daysSinceRegistered}}天</li>
                </ul>
            </li>
            <li>运行数据统计
                <ul>
                    <li>日均运行时长：{{thisDevice.statistics.running.dailyAverage|number:2}}h</li>
                    <li>月均运行时长：{{thisDevice.statistics.running.monthlyAverage|number:2}}h</li>
                    <li>年均运行时长：{{thisDevice.statistics.running.annualAverage|number:2}}h</li>
                    <li>当月运行总时长：{{thisDevice.statistics.running.totalInMonth|number:2}}h</li>
                    <li>当年运行总时长：{{thisDevice.statistics.running.totalInYear|number:2}}h</li>
                </ul>
            </li>
            <li>保养数据统计
                <ul>
                    <li>总保养次数：{{thisDevice.statistics.maintain.totalTimes}}</li>
                    <li ng-repeat="maintain in thisDevice.statistics.maintain.maintainsStatistics">
                        {{maintain.maintainName}}
                        <ul>
                            <li>保养次数：{{maintain.totalTimes}}</li>
                            <li>当年保养次数：{{maintain.totalInYear|number:2}}</li>
                            <li>当月保养次数：{{maintain.totalInMonth|number:2}}</li>
                            <li>月均保养次数：{{maintain.monthlyAverageTimes|number:2}}</li>
                            <li>年均保养次数：{{maintain.annualAverageTimes|number:2}}</li>
                            <li>保养次数：{{maintain.annualAverageTimes}}</li>
                        </ul>
                    </li>
                </ul>
            </li>
            <li>维修数据统计
                <ul>
                    <li>当年总维修次数：{{thisDevice.statistics.repair.totalInMonth}}</li>
                    <li>当月总维修次数：{{thisDevice.statistics.repair.totalInYear}}</li>
                    <li>总维修次数：{{thisDevice.statistics.repair.totalTimes}}</li>
                    <li>月度维修率：{{thisDevice.statistics.repair.monthlyRate | percentage}}</li>
                    <li>年度维修率：{{thisDevice.statistics.repair.annuallyRate | percentage}}</li>
                    <li>当年维修总支出：{{thisDevice.statistics.repair.totalCostInYear | currency:'￥'}}</li>
                    <li>当月维修总支出：{{thisDevice.statistics.repair.totalCostInMonth | currency:'￥'}}</li>
                    <li>维修总支出：{{thisDevice.statistics.repair.totalCost | currency:'￥'}}</li>
                    <li>维修总耗用时间：{{thisDevice.statistics.repair.totalCostTime}}h</li>
                </ul>
            </li>
            <li>总统计
                <ul>
                    <li>设备开机率：{{thisDevice.statistics.total.bootRate | percentage}}</li>
                    <li>设备故障率：{{thisDevice.statistics.total.failureRate | percentage}}</li>
                </ul>
            </li>
        </ul>
    </div>
</div>


<div ng-init="suiMobileInit()"></div>